# Freddy Teuma - 30 novembre 2009
# -Modification du makefile-

CXX = g++ -Wall
LD = g++

SRC_PATH = src

SERV_SRC = 		serverCmd.cpp \
				server.cpp \
				prompt.cpp \
				fstring.cpp \
				user.cpp \
				log.cpp

CLI_SRC = 		clientCmd.cpp\
				client.cpp \
				prompt.cpp \
				fstring.cpp


BIN = serverCmd clientCmd

SERV_OBJ = $(SERV_SRC:.cpp=.o)
CLI_OBJ = $(CLI_SRC:.cpp=.o)
DEP = $(CLI_SRC:.cpp=.d) \
		$(SERV_SRC:.cpp=.d)

%.o: $(SRC_PATH)/%.cpp
	$(CXX) -g -o $@ -c $<

%.d: $(SRC_PATH)/%.cpp
	$(CXX) $< -MM -o $@

all: $(BIN)

serverCmd: $(SERV_OBJ)
	$(LD) -o $@ $+

clientCmd: $(CLI_OBJ)
	$(LD) -o $@ $+

clean:
	@rm *.o *.d
	@rm *.log
#	$rm $(BIN)

cleanpdf:
	@rm *.d *.aux *.idx *.lof *.log *.toc

-include $(DEP)
